import SvgIcon from './SvgIcon/index.vue'
import { App } from 'vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const globalComponents: { [index: string]: any } = {
  SvgIcon,
}

export default {
  install(app: App) {
    console.log(app)
    console.log(globalComponents)
    Object.keys(globalComponents).forEach((key) => {
      // fixme 类型细化
      app.component(key, globalComponents[key])
    })

    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
    }
  },
}
